from base.base import Base
from selenium.webdriver.common.by import By
from time import sleep

class SousuoPage(Base):

    sousuokuang=(By.ID,'com.kongfz.app:id/ll_search')

    shurukuang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[2]/android.widget.EditText')

    sousuoanniu=(By.XPATH,'//android.widget.TextView[@text="搜索"]')

    dy1=(By.XPATH,'//android.widget.TextView[@text="墨池书院旧书店"]')

    dy2=(By.XPATH,'//android.widget.TextView[@text="长安知博书店"]')

    def sousuoyewu(self,password):

        self.loc_ele(self.sousuokuang).click()
        sleep(2)

        self.loc_ele(self.shurukuang).send_keys(password)
        sleep(2)

        self.loc_ele(self.sousuoanniu).click()
        sleep(2)